﻿#include <iostream>
class MoveObject{
public:
    virtual void test(){}
};
class Monster :public MoveObject{};
int main()
{
    int a=1;
    std::cout << typeid(a).name() << std::endl;//int,typeid(a)返回引用

    long long b;
    std::cout << typeid(b).name() << std::endl;//__int64

    MoveObject* _move = new MoveObject();
    _move = new Monster();
    std::cout << typeid(*_move).name() << std::endl;//class MoveObject *，不是class Monster的原因是，首先需要*对指针解除引用，其次类不是多态
    std::cout << typeid(*_move).name() << std::endl;//class Monster，加上前提后成功

    Monster wolf;
    MoveObject& lMove = wolf;
    std::cout << typeid(lMove).name() << std::endl;//class Monster

    if (typeid(lMove) == typeid(Monster))
        std::cout << "Right!" << std::endl;
}